package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;

import com.blankj.utilcode.util.ToastUtils;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityPlayUriBinding;
import stark.common.basic.event.EventStatProxy;
import stark.common.basic.utils.FastClickUtil;

public class PlayUriActivity extends BaseAc<ActivityPlayUriBinding> {



    @Override
    protected int onCreate() {
        return R.layout.activity_play_uri;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(this, mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(this, mDataBinding.event5Container);
        mDataBinding.ivPlayUriBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        mDataBinding.ivPlayUri.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        if (FastClickUtil.isFastClick()) return;
        switch (v.getId()){
            case R.id.ivPlayUri:
                String videoPath = mDataBinding.etPlayUriText.getText().toString();
                if (TextUtils.isEmpty(videoPath)) {
                    ToastUtils.showShort(getString(R.string.please_input_play_uri));
                    return;
                }
                PlayActivity.videoUri = videoPath;
                startActivity(PlayActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}